<?php /* @var $this Controller */ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
    xmlns="http://www.w3.org/1999/xhtml"
    xml:lang="en"
    lang="en">
<head>
<meta
    http-equiv="Content-Type"
    content="text/html; charset=utf-8" />
<meta
    name="language"
    content="en" />

<!-- blueprint CSS framework -->
<link
    rel="stylesheet"
    type="text/css"
    href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css"
    media="screen, projection" />
<link
    rel="stylesheet"
    type="text/css"
    href="<?php echo Yii::app()->request->baseUrl; ?>/css/print.css"
    media="print" />
<!--[if lt IE 8]>
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" />
	<![endif]-->


<!--	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />-->

<title><?php echo CHtml::encode($this->pageTitle); ?></title>

<link
    rel="stylesheet"
    type="text/css"
    href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" />

</head>

<body>

    <div class="container" id="pageContainer">
        <div class="row">

            <div class="span3">

                <div
                    id="mainmenu"
                    class="widget-box">

                    <div class="widget-title">
                        <h1>
                            <?php echo CHtml::link(CHtml::encode(Yii::app()->name), array('/')); ?>
                        </h1>
                    </div>

                    <div class="widget-content">

                        <?php if( !user()->isGuest ) $this->widget('bootstrap.widgets.BootMenu',array(
                                'type'=>'list',
                                'items'=> array(
                                array('label'=>'ÁLTALÁNOS FUNKCIÓK'),
                                array('label'=>'Home', 'icon'=>'home', 'url'=>array('/site/index')),
                                array('label'=>'Felhasználók', 'icon'=>'user', 'url'=>array('/user/index'), 'visible'=>checkAccess('admin')),
                                array('label'=>'Háztömbök', 'icon'=>'th', 'url'=>array('/block/index'), 'visible'=>checkAccess('delegate')),
                                array('label'=>'Lakások', 'icon'=>'th', 'url'=>array('/flat/index'), 'visible'=>checkAccess('delegate')),

                                array('label'=>'RIGHTS', 'visible'=>checkAccess('admin')),
                                array('label'=>'Jogosultságok', 'url'=>array('/rights/authItem/permissions'), 'visible'=>checkAccess('admin')),
                                array('label'=>'Szerepkörök', 'url'=>array('/rights/authItem/roles'), 'visible'=>checkAccess('admin')),
                                array('label'=>'Feledatok', 'url'=>array('/rights/authItem/tasks'), 'visible'=>checkAccess('admin')),
                                array('label'=>'Műveletek', 'url'=>array('/rights/authItem/operations'), 'visible'=>checkAccess('admin')),
                                array('label'=>'Hozzárendelések', 'url'=>array('/rights/assignment/view'), 'visible'=>checkAccess('admin')),

                                array(),
                                array('label'=>'Logout ('.user()->name.')', 'url'=>array('/site/logout'), 'visible'=>!user()->isGuest)

                            ),
                        )); ?>

                    </div>
                </div>
                <!-- mainmenu -->

            </div>
            <div class="span9">

                <?php if(isset($this->breadcrumbs)):?>
                <?php $this->widget('bootstrap.widgets.BootBreadcrumbs', array(
                        'separator'=>'/',
                        'homeLink'=>CHtml::link('Főoldal', array('/')),
                        'links'=>$this->breadcrumbs,
				)); ?>
                <!-- breadcrumbs -->
                <?php endif; ?>

                <?php $this->widget('bootstrap.widgets.BootAlert'); ?>

                <div class="widget-box">

                    <div
                        id="content"
                        class="widget-content">

                        <?php

                        if( method_exists($this,'getMenu') && count($this->getMenu()) > 0){
                                 $this->widget('bootstrap.widgets.BootMenu', array(
                        			'items'=>$this->getMenu(),
                        		    'type'=>'pills',
                        			'htmlOptions'=>array('class'=>'operations', 'style'=>"padding: 2px 5px; background: #fff; border-radius: 8px; border: 1px silver solid; margin-bottom: 10px;"),
                        		));

                            }

                            ?>


                        <?php echo $content; ?>
                    </div>
                    <!-- content -->
                </div>

            </div>

        </div>

             <div id="footer" class="row well">
            <?php echo Yii::powered(); ?>
            </div>

    </div>
    <!-- page -->

</body>
</html>
